package xxx.host.mpapi.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author yuanchengman
 * @date 2021-08-16
 */
@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean<CorsFilter> myCorsFilter() {
        FilterRegistrationBean<CorsFilter> registration = new FilterRegistrationBean<>();
        registration.setFilter(new CorsFilter());
        registration.addUrlPatterns("/*");
        registration.setName("myCorsFilter");
        registration.setOrder(2);
        return registration;
    }
}
